home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / nodee1a.zip / SOURCE.ZIP / NODEE.CPP < prev    next >
C/C++ Source or Header  |  1991-09-15  |  16KB  |  699 lines

  1. /*
  2.  
  3. NOCTRL.CPP
  4. version 1.2
  5.  
  6. written by James D. Rudnicki
  7. jdrudnicki@lbl.gov
  8. last update Septmeber 1991
  9.  
  10. written with Borland C++ 2.0 */
  11.  
  12. // Access the libraries needed
  13.  
  14.     #ifndef __WINDOWS_H
  15.         #include <windows.h>
  16.     #endif
  17.  
  18.     #include <stdlib.h>
  19.     #include <stdio.h>
  20.     #include <iostream.h>
  21.     #include <fstream.h>
  22.  
  23.     #ifndef __STRING_H
  24.         #include <string.h>
  25.     #endif
  26.  
  27.     #ifndef __DIR_H
  28.         #include <dir.h>
  29.     #endif
  30.  
  31.  
  32. // symbol tables
  33.     #ifndef __NOD1_H
  34.     #include "nod1.h"
  35.     #endif
  36.  
  37.     #ifndef __PS_H
  38.         #include "ps.h"
  39.     #endif
  40.  
  41.  
  42. /*-------------------------------------------
  43. All dialog boxes are included from a separate file.
  44. An independent symbol table is used. */
  45.  
  46.     #ifndef __CLASSWIN_H
  47.         #include <classwin.h>
  48.     #endif
  49.     #ifndef _NODDLGS_H
  50.         #include "noddlgs.h"
  51.     #endif
  52.     #ifndef __NODCHILD_H
  53.         #include "nodchild.h"
  54.     #endif
  55.  
  56.  
  57. /*------------------------------------------------------------
  58.  The Main Window class
  59.  
  60. NoDWindow - constructor reads the private profile strings
  61.  
  62. ~NoDWindow - writes out the private profile strings
  63.  
  64. */
  65.  
  66.     #pragma arsused
  67.  
  68.     class NoDWindow : public Window
  69.     {
  70.     public:
  71.         NoDWindow();
  72.         ~NoDWindow();
  73.  
  74.     protected:
  75.         virtual LONG dispatch(WORD,WORD,LONG);
  76.         virtual BOOL registerClass();
  77.         virtual BOOL createWindow();
  78.  
  79.     private:
  80.  
  81. /* defaults from Private profile*/
  82.  
  83.         char szDefDir[MAXPATH];
  84.         BOOL bOneClick;
  85.         BOOL bInstantStrip;
  86.         BOOL bUseFileMask;
  87.         BOOL bFirstRun;
  88.         char szFileMask[MAXFULLFILE];
  89.  
  90. // member data
  91.  
  92.         static char szClassName[14];
  93.         int cxChar,cxCaps,cyChar;
  94.         int cxClient,cyClient,cxBit,cyBit;
  95.         HMENU hMenu;
  96.  
  97. // these member functions process commands
  98.  
  99.         BOOL processMenuCommand(WORD,long);
  100.         BOOL processChildCommand(WORD,long);
  101.  
  102. // these member functions are the workers
  103.  
  104.         void flash(BOOL);
  105.  
  106.         void helpAboutBox(void);
  107.         void paint( void );
  108.  
  109. // child windows are declared here and created later
  110.  
  111.         GoButton gb;
  112.         FirstLine fl;
  113.         FileFinder childFileList;
  114.  
  115. // one Postscript file is needed
  116.  
  117.         PSFile PSCleanFile;
  118.  
  119.     };
  120.  
  121.  
  122.     char NoDWindow::szClassName[] = "No ^D !";
  123.  
  124. /* The constructor and destructors read and write the default
  125. values to the private initialization file */
  126.  
  127.     NoDWindow::NoDWindow()
  128.     {
  129.         if    (GetPrivateProfileString
  130.                 ("NoDee","Mask","",szFileMask,MAXFULLFILE,PRIVATEINI) != 0)
  131.         {
  132.             bFirstRun=FALSE;
  133.  
  134.             GetPrivateProfileString
  135.                 ("NoDee","DefDir","",szDefDir,MAXPATH,PRIVATEINI);
  136.  
  137.             bOneClick =
  138.                 (GetPrivateProfileInt("NoDee","OneClick",1,PRIVATEINI) == 0)
  139.                 ? FALSE : TRUE;
  140.  
  141.             bInstantStrip =
  142.                 (GetPrivateProfileInt("NoDee","InstantStrip",1,PRIVATEINI) == 0)
  143.                  ? FALSE : TRUE;
  144.  
  145.             bUseFileMask =
  146.                 (GetPrivateProfileInt("NoDee","UseMask",1,PRIVATEINI) == 0)
  147.                  ? FALSE : TRUE;
  148.  
  149.         }
  150.         else
  151.         {
  152.             bFirstRun=TRUE;
  153.             strcpy(szFileMask,"*.PS");
  154.             bOneClick=FALSE;
  155.             bInstantStrip=FALSE;
  156.             bUseFileMask=FALSE;
  157.         }
  158.     }
  159.  
  160.     NoDWindow::~NoDWindow()
  161.     {
  162.         WritePrivateProfileString
  163.             ("NoDee","Mask",szFileMask,PRIVATEINI);
  164.  
  165.         WritePrivateProfileString
  166.             ("NoDee","DefDir",szDefDir,PRIVATEINI);
  167.  
  168.         WritePrivateProfileString
  169.             ("NoDee","OneClick",bOneClick ? "1" : "0",PRIVATEINI);
  170.  
  171.         WritePrivateProfileString
  172.             ("NoDee","InstantStrip",bInstantStrip ? "1":"0",PRIVATEINI);
  173.  
  174.         WritePrivateProfileString
  175.             ("NoDee","UseMask",bUseFileMask ? "1" : "0",PRIVATEINI);
  176.     }
  177.  
  178. /* Define the members of NoDWindow */
  179.  
  180.  
  181.         BOOL NoDWindow::registerClass( void )
  182.         {
  183.             WNDCLASS wc;
  184.  
  185.             wc.style         = CS_HREDRAW | CS_VREDRAW;
  186.             wc.lpfnWndProc   = &Window::wndProc;
  187.             wc.cbClsExtra    = 0;
  188.             wc.cbWndExtra    = 0;
  189.             wc.hInstance     = hInst;
  190.             wc.hIcon         = LoadIcon( hInst, "nodee" );
  191.             wc.hCursor       = LoadCursor( NULL, IDC_ARROW );
  192.             wc.hbrBackground = GetStockObject( WHITE_BRUSH );
  193.             wc.lpszMenuName  = "MENU";
  194.             wc.lpszClassName = (LPSTR)szClassName;
  195.  
  196.             return RegisterClass( &wc ) ;
  197.         }
  198.  
  199.  
  200.         BOOL NoDWindow::createWindow( void )
  201.         {
  202.             HDC hdc;
  203.             TEXTMETRIC tm;
  204.             char szTemp[MAXPATH];
  205.  
  206.             hdc=CreateIC("DISPLAY",NULL,NULL,NULL);
  207.             SelectObject(hdc,GetStockObject(SYSTEM_FIXED_FONT));
  208.             GetTextMetrics(hdc,&tm);
  209.             cxChar=tm.tmAveCharWidth;
  210.             cyChar=tm.tmHeight+tm.tmExternalLeading;
  211.             ReleaseDC(hWindow,hdc);
  212.  
  213.             hWindow = CreateWindow
  214.                 ( szClassName,
  215.                     szClassName,
  216.                     WS_OVERLAPPED|WS_SYSMENU|WS_CAPTION|
  217.                     WS_DLGFRAME|WS_VISIBLE|WS_MINIMIZEBOX,
  218.                     CW_USEDEFAULT,CW_USEDEFAULT,
  219.                     CXMYWINDOW,CYMYWINDOW,
  220.                     NULL,
  221.                     NULL,
  222.                     hInst,
  223.                     NULL);
  224.  
  225.             if ( hWindow==0 )    return( FALSE );
  226.             insert();
  227.  
  228. /* Evaluate the command line as follows:
  229.  
  230. - If the command line is a valid fully qualified filename,
  231.     go to that directory and set the file name.
  232. - If the command line is just a filename, search in the current directory
  233.     then the DefDir.  If the file is valid, go to that directory and
  234.     set the file name.
  235. - If the command line is a valid directory, go to that directory.
  236. - Go to the default directory.
  237.  
  238. */
  239.  
  240.             OFSTRUCT o;
  241.             char * i;
  242.  
  243.             _fstrncpy((char far *)szTemp,(char far *) (WinBase::cmd),MAXPATH);
  244.  
  245.             if (szTemp[1] == ':')
  246.             {
  247.                 strlwr(szTemp);
  248.                 setdisk((int) (szTemp[0]) -  'a');
  249.             }
  250.  
  251.             if (_fstrlen(WinBase::cmd) != 0)
  252.             {
  253.                 if (-1 != OpenFile(WinBase::cmd,&o,OF_READ|OF_EXIST) )
  254.                 {
  255.  
  256.                     if (_fstrrchr((char far *)o.szPathName,'\\') != NULL)
  257.                     {
  258.                         strcpy(szTemp,(char *)o.szPathName);
  259.                         i = strrchr(szTemp,'\\') ;
  260.                         *i = '\0';
  261.                         chdir(szTemp);
  262.                         PSCleanFile.SetFile((char *)o.szPathName);
  263.                     }
  264.                     else
  265.                     {
  266.                         PSCleanFile.SetFile((char *)o.szPathName);
  267.                     }
  268.  
  269.                 }
  270.                 else
  271.                 {
  272.                     chdir(szDefDir);
  273.  
  274.                     if (-1 != OpenFile(WinBase::cmd,&o,OF_READ|OF_EXIST) )
  275.                     {
  276.                         PSCleanFile.SetFile((char *)o.szPathName);
  277.                     }
  278.                     else
  279.                     {
  280.                         _fstrncpy((char far *)szTemp,(char far *) (WinBase::cmd),MAXPATH);
  281.                         if (chdir(szTemp) != 0 )
  282.                             chdir(szDefDir);
  283.                     }
  284.                 }
  285.             }
  286.             else
  287.             {
  288.                 chdir(szDefDir);
  289.             }
  290.  
  291.  
  292. /* Initialize the menu states. The checks are set and the
  293. menu text is adjusted to indicate the mask indicated in the
  294. private profile file */
  295.  
  296.             hMenu=GetMenu(hWindow);
  297.             strcpy(szTemp,"Use Mask ");
  298.             strcat(szTemp,szFileMask);
  299.             ModifyMenu(hMenu, IDM_OPT1C, MF_BYCOMMAND||MF_STRING,
  300.                 IDM_OPT1C, (LPSTR) szTemp);
  301.  
  302.             CheckMenuItem(hMenu,IDM_OPT1A,bInstantStrip ? MF_CHECKED:MF_UNCHECKED);
  303.             CheckMenuItem(hMenu,IDM_OPT1B,bOneClick ? MF_CHECKED:MF_UNCHECKED);
  304.             CheckMenuItem(hMenu,IDM_OPT1C,bUseFileMask ? MF_CHECKED:MF_UNCHECKED);
  305.  
  306. /* create child windows */
  307.  
  308.             gb.create(hWindow);
  309.             fl.create(hWindow);
  310.  
  311.             EnableWindow(gb.getHandle(),FALSE);
  312.  
  313.             if(PSCleanFile.ValidFile())
  314.                 fl.set(PSCleanFile.JustName());
  315.             else
  316.                 fl.set("nothing selected");
  317.  
  318.             childFileList.mask(bUseFileMask ? szFileMask : "*.*" );
  319.             childFileList.create(hWindow);
  320.  
  321.             if (PSCleanFile.ValidFile())
  322.                 PSCleanFile.test();
  323.  
  324. /* initialize the cursor */
  325.  
  326.             SetClassWord
  327.                 (childFileList.FileList::getHandle(), GCW_HCURSOR,    bInstantStrip ?
  328.                 LoadCursor(hInst,"NODEE"):LoadCursor(NULL,IDC_ARROW) );
  329.  
  330.  
  331.             ShowWindow(hWindow,show );
  332.             UpdateWindow(hWindow);
  333.  
  334.  
  335. /* if first time running the program launch the
  336. help application */
  337.  
  338.             if (bFirstRun)
  339.                 WinHelp(hWindow,HELPFILE,HELP_INDEX,NULL);
  340.  
  341.             return TRUE;
  342.         }
  343.  
  344.  
  345.     void NoDWindow::paint( void )
  346.     {
  347.         PAINTSTRUCT ps;
  348.         HDC hdc;
  349.         hdc=BeginPaint( hWindow, &ps );
  350.         TextOut(hdc,XFILETAG,YFILETAG,"Testing File:",13);
  351.         TextOut(hdc,XDIRTAG,YDIRTAG,"Directory:",10);
  352.         EndPaint( hWindow, &ps );
  353.     }
  354.  
  355.     void NoDWindow::flash(BOOL a)
  356.     {
  357.         BITMAP bm;
  358.         HDC hdcMem;
  359.         DWORD dwSize;
  360.         POINT ptSize,ptOrg;
  361.         HANDLE hPoint,hDC;
  362.         DWORD lParam;
  363.  
  364.         if (a)
  365.         {
  366.  
  367.         hPoint=LoadBitmap(WinBase::hInst,"D1");
  368.  
  369.         hDC=GetDC(hWindow);
  370.         hdcMem=CreateCompatibleDC(hDC);
  371.         SelectObject(hdcMem,hPoint);
  372.         SetMapMode(hdcMem,GetMapMode(hDC));
  373.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  374.         ptSize.x=bm.bmWidth;
  375.         ptSize.y=bm.bmHeight;
  376.         DPtoLP(hDC,&ptSize,1);
  377.         ptOrg.x=0;
  378.         ptOrg.y=0;
  379.         DPtoLP(hdcMem,&ptOrg,1);
  380.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  381.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  382.  
  383.         DeleteDC(hdcMem);
  384.         ReleaseDC(hWindow,hDC);
  385.  
  386.         }
  387.         else
  388.         {
  389.  
  390.  
  391.         hDC=GetDC(hWindow);
  392.         hdcMem=CreateCompatibleDC(hDC);
  393.  
  394.         hPoint=LoadBitmap(WinBase::hInst,"D1");
  395.         SelectObject(hdcMem,hPoint);
  396.         SetMapMode(hdcMem,GetMapMode(hDC));
  397.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  398.         ptSize.x=bm.bmWidth;
  399.         ptSize.y=bm.bmHeight;
  400.         DPtoLP(hDC,&ptSize,1);
  401.         ptOrg.x=0;
  402.         ptOrg.y=0;
  403.         DPtoLP(hdcMem,&ptOrg,1);
  404.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  405.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  406.  
  407.         hPoint=LoadBitmap(WinBase::hInst,"D2");
  408.         SelectObject(hdcMem,hPoint);
  409.         SetMapMode(hdcMem,GetMapMode(hDC));
  410.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  411.         ptSize.x=bm.bmWidth;
  412.         ptSize.y=bm.bmHeight;
  413.         DPtoLP(hDC,&ptSize,1);
  414.         ptOrg.x=0;
  415.         ptOrg.y=0;
  416.         DPtoLP(hdcMem,&ptOrg,1);
  417.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  418.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  419.  
  420.         hPoint=LoadBitmap(WinBase::hInst,"D3");
  421.         SelectObject(hdcMem,hPoint);
  422.         SetMapMode(hdcMem,GetMapMode(hDC));
  423.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  424.         ptSize.x=bm.bmWidth;
  425.         ptSize.y=bm.bmHeight;
  426.         DPtoLP(hDC,&ptSize,1);
  427.         ptOrg.x=0;
  428.         ptOrg.y=0;
  429.         DPtoLP(hdcMem,&ptOrg,1);
  430.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  431.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  432.  
  433.         hPoint=LoadBitmap(WinBase::hInst,"D4");
  434.         SelectObject(hdcMem,hPoint);
  435.         SetMapMode(hdcMem,GetMapMode(hDC));
  436.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  437.         ptSize.x=bm.bmWidth;
  438.         ptSize.y=bm.bmHeight;
  439.         DPtoLP(hDC,&ptSize,1);
  440.         ptOrg.x=0;
  441.         ptOrg.y=0;
  442.         DPtoLP(hdcMem,&ptOrg,1);
  443.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  444.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  445.  
  446.         hPoint=LoadBitmap(WinBase::hInst,"D4");
  447.         SelectObject(hdcMem,hPoint);
  448.         SetMapMode(hdcMem,GetMapMode(hDC));
  449.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  450.         ptSize.x=bm.bmWidth;
  451.         ptSize.y=bm.bmHeight;
  452.         DPtoLP(hDC,&ptSize,1);
  453.         ptOrg.x=0;
  454.         ptOrg.y=0;
  455.         DPtoLP(hdcMem,&ptOrg,1);
  456.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  457.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  458.  
  459.         hPoint=LoadBitmap(WinBase::hInst,"D5");
  460.         SelectObject(hdcMem,hPoint);
  461.         SetMapMode(hdcMem,GetMapMode(hDC));
  462.         GetObject(hPoint,sizeof(BITMAP),(LPSTR) &bm);
  463.         ptSize.x=bm.bmWidth;
  464.         ptSize.y=bm.bmHeight;
  465.         DPtoLP(hDC,&ptSize,1);
  466.         ptOrg.x=0;
  467.         ptOrg.y=0;
  468.         DPtoLP(hdcMem,&ptOrg,1);
  469.         BitBlt(hDC,cxClient-ptSize.x,0,ptSize.x,ptSize.y,
  470.                         hdcMem,ptOrg.x,ptOrg.y,SRCCOPY);
  471.  
  472.         DeleteDC (hdcMem);
  473.         ReleaseDC(hWindow,hDC);
  474.  
  475.         }
  476.  
  477.     }
  478.  
  479.  
  480.     void NoDWindow::helpAboutBox()
  481.     {
  482.         AboutBox x(hWindow);
  483.         x.run();
  484.     }
  485.  
  486.     BOOL NoDWindow::processMenuCommand(WORD wParam, long lParam)
  487.     {
  488.         switch(wParam)
  489.         {
  490.         case IDM_OPT1A:
  491.             bInstantStrip=!bInstantStrip;
  492.             if (bInstantStrip)
  493.             {
  494.                 CheckMenuItem(hMenu,IDM_OPT1A,MF_CHECKED);
  495.                 SetClassWord
  496.                     (childFileList.FileList::getHandle(),GCW_HCURSOR,LoadCursor(hInst,"NODEE"));
  497.             }
  498.             else
  499.             {
  500.                 CheckMenuItem(hMenu,IDM_OPT1A,MF_UNCHECKED);
  501.                 SetClassWord
  502.                     (childFileList.FileList::getHandle(),GCW_HCURSOR,LoadCursor(NULL,IDC_ARROW));
  503.             }
  504.             if (bInstantStrip && PSCleanFile.test())
  505.                 PSCleanFile.strip();
  506.             return TRUE;
  507.  
  508.         case IDM_OPT1B:
  509.             CheckMenuItem(hMenu,IDM_OPT1B,(bOneClick = !bOneClick) ?
  510.                 MF_CHECKED:MF_UNCHECKED);
  511.             return TRUE;
  512.  
  513.         case IDM_OPT1C:
  514.             CheckMenuItem(hMenu,IDM_OPT1C,(bUseFileMask = !bUseFileMask) ?
  515.                 MF_CHECKED:MF_UNCHECKED);
  516.             childFileList.mask(bUseFileMask ? szFileMask : "*.*" );
  517.             childFileList.reset();
  518.             return TRUE;
  519.  
  520.  
  521.         case IDM_H1B:
  522.             helpAboutBox();
  523.             flash(FALSE);
  524.             return TRUE;
  525.  
  526.         case IDM_H1C:
  527.             WinHelp(hWindow,HELPFILE,HELP_INDEX,NULL);
  528.             return TRUE;
  529.  
  530.         default:
  531.             return FALSE;
  532.         }
  533.     }
  534.  
  535.     BOOL NoDWindow::processChildCommand(WORD wParam, long lParam)
  536.     {
  537.         int i;
  538.         switch(wParam)
  539.         {
  540.         case MYCW_ICKBUTTON:
  541.         case MYCW_GOBUTTON:
  542.             PSCleanFile.strip();
  543.             if (PSCleanFile.test())
  544.             {
  545.                 EnableWindow(gb.getHandle(),TRUE);
  546.                 SetFocus(gb.getHandle());
  547.             }
  548.             else
  549.             {
  550.                 EnableWindow(gb.getHandle(),FALSE);
  551.                 SetFocus(hWindow);
  552.             }
  553.             return TRUE;
  554.  
  555.         case MYCW_FILELIST:
  556.             if ( (HIWORD (lParam) == LBN_DBLCLK ) ||
  557.                      bOneClick && (HIWORD (lParam) == LBN_SELCHANGE) )
  558.             {
  559.                 if (childFileList.fileClick())
  560.                 {
  561.                     if (childFileList.validFile())
  562.                     {
  563.                         PSCleanFile.SetFile(childFileList.getFile());
  564.                         fl.set(PSCleanFile.JustName());
  565.                         if (PSCleanFile.test())
  566.                         {
  567.                             if (bInstantStrip)
  568.                             {
  569.                                 PSCleanFile.strip();
  570.                             }
  571.                             else
  572.                             {
  573.                             EnableWindow(gb.getHandle(),TRUE);
  574.                             SetFocus(gb.getHandle());
  575.                             }
  576.                         }
  577.                         else
  578.                         {
  579.                             EnableWindow(gb.getHandle(),FALSE);
  580.                             SetFocus(hWindow);
  581.                         }
  582.                     }
  583.                     return TRUE;
  584.                 }
  585.             }
  586.             return FALSE;
  587.  
  588.         case MYCW_DIRLIST:
  589.         case MYCW_DIRFIELD:
  590.             if ( (HIWORD (lParam) == LBN_DBLCLK ) ||
  591.                      bOneClick && (HIWORD (lParam) == LBN_SELCHANGE) )
  592.             {
  593.                 if (childFileList.dirClick())
  594.                 {
  595.                     fl.set("none selected");
  596.                     EnableWindow(gb.getHandle(),FALSE);
  597.                     SetFocus(hWindow);
  598.                     return TRUE;
  599.                 }
  600.             }
  601.             return FALSE;
  602.  
  603.         }
  604.         return FALSE;
  605.     }
  606.  
  607. /* This is the big switch
  608.  
  609. NOTE: Do no process the WM_CREATE message here.
  610. Upon the WM_CREATE message, the handle hWnd is not yet
  611. valid.  Do not use the handle until the CreateWindow call in the
  612. constructor has completed execution.  Any code which need be executed
  613. on creation can be placed in the create function .
  614.  
  615. This differs from normal C programs.  When CreateWindow sends the WM_CREATE
  616. message, the window handle is also passed to WndProc.  Thereby, the
  617. first processing of WM_CREATE will have access to the handle. */
  618.  
  619.     long NoDWindow::dispatch( WORD iMessage, WORD wParam, LONG lParam )
  620.     {
  621.         switch (iMessage)
  622.         {
  623.  
  624.             case WM_PAINT:
  625.                 paint();
  626.                 return 0;
  627.  
  628.             case WM_SIZE:
  629.                 cxClient=LOWORD(lParam);
  630.                 cyClient=HIWORD(lParam);
  631.                 return 0;
  632.  
  633. /* commands are send to the Menu processor, and then the Child processor
  634. If neither of these routines indicates it handled the command, the
  635. default procedure will be called. */
  636.  
  637.             case WM_COMMAND:
  638.                 if(processMenuCommand(wParam,lParam))
  639.                     return 0;
  640.                 if(processChildCommand(wParam,lParam))
  641.                     return 0;
  642.                 break;
  643.  
  644. /* catch this message - The file list should be updated when the
  645. program has not been active. */
  646.  
  647.             case WM_ACTIVATEAPP:
  648.                 if(wParam != 0)
  649.                 {
  650.                     childFileList.reset();
  651.                     SetClassWord
  652.                         (childFileList.FileList::getHandle(),GCW_HCURSOR,bInstantStrip?
  653.                         LoadCursor(hInst,"NODEE"):LoadCursor(NULL,IDC_ARROW) );
  654.                 }
  655.                 else
  656.                 {
  657.                     SetClassWord
  658.                         (childFileList.FileList::getHandle(), GCW_HCURSOR,
  659.                          LoadCursor(NULL,IDC_ARROW) );
  660.                 }
  661.  
  662.                 return 0;
  663.  
  664.             case WM_DESTROY:
  665.                 SetClassWord
  666.                 (childFileList.FileList::getHandle(), GCW_HCURSOR,
  667.                  LoadCursor(NULL,IDC_ARROW) );
  668.                 WinHelp(hWindow,HELPFILE,HELP_QUIT,NULL);
  669.  
  670.                 PostQuitMessage( 0 );
  671.                 return 0;
  672.  
  673.         }
  674.  
  675.         return Window::dispatch( iMessage, wParam, lParam );
  676.  
  677.     }
  678.  
  679.  
  680. /*-------------------------------------------------------------
  681. This is the end of the Main program.  The following procedures are
  682. called from Windows directly */
  683.  
  684.  
  685.  
  686.     int PASCAL WinMain
  687.         (HANDLE hInstance,HANDLE hPrev,LPSTR lpszCmdLine,int nCmdShow)
  688.     {
  689.         WinBase::hInst = hInstance;
  690.         WinBase::hPrevInst = hPrev;
  691.         WinBase::cmd = lpszCmdLine;
  692.         WinBase::show = nCmdShow;
  693.  
  694.         NoDWindow A;
  695.         A.create();
  696.         return A.run();
  697.     }
  698.  
  699.